package com.jiazhong.basic.shuxin.thread.a;

import lombok.SneakyThrows;

public class DemoB {

    @SneakyThrows
    public synchronized void b1() {
        String currentThreadName = Thread.currentThread().getName();
        System.out.println(currentThreadName + "开始执行操作");
        wait();
        System.out.println(currentThreadName + "结束执行操作");
    }

    public synchronized void b2() {
        // notify();
        notifyAll();
    }

    @SneakyThrows
    public synchronized void b3() {
        String currentThreadName = Thread.currentThread().getName();
        System.out.println(currentThreadName + "开始执行操作");
        wait(4000);
        System.out.println(currentThreadName + "结束执行操作");
    }
}
